#ifndef VECTOR_HPP
#define VECTOR_HPP
#include "GLHeaders.hpp"

class Vector{
public:
  GLfloat x,y,z;

public:
  //Constructor
  Vector(void);
  Vector(const GLfloat fa);  
  Vector(const GLfloat fx, const GLfloat fy, const GLfloat fz=1.0f);
  Vector(const Vector& vector);

  //Arithmetic operations
  Vector operator + () const;
  Vector operator - () const;
  Vector operator + (const Vector &rhs) const;
  Vector operator + (const GLfloat value) const;
  Vector operator - (const Vector &rhs) const;
  Vector operator - (const GLfloat value) const;
  Vector operator * (const Vector &rhs) const;
  Vector operator * (const GLfloat value) const;
  Vector operator / (const Vector &rhs) const;
  Vector operator / (const GLfloat value) const;
  Vector operator ^ (const Vector &rhs) const;
  
  friend Vector operator + (const GLfloat value, const Vector &rhs);
  friend Vector operator - (const GLfloat value, const Vector &rhs);
  friend Vector operator * (const GLfloat value, const Vector &rhs);
  friend Vector operator / (const GLfloat value, const Vector &rhs);

  //Boolean operation
  bool operator <  (const Vector &rhs) const;
  bool operator <= (const Vector &rhs) const;
  bool operator == (const Vector &rhs) const;  
  bool operator != (const Vector &rhs) const;
  bool operator >= (const Vector &rhs) const;
  bool operator >  (const Vector &rhs) const;
  
  //Arithmetic updates
  Vector& operator  = (const Vector &rhs);
  Vector& operator  = (const GLfloat value);
  Vector& operator += (const Vector &rhs);
  Vector& operator += (const GLfloat value);
  Vector& operator -= (const Vector &rhs);
  Vector& operator -= (const GLfloat value);
  Vector& operator *= (const Vector &rhs);
  Vector& operator *= (const GLfloat value);
  Vector& operator /= (const Vector &rhs);
  Vector& operator /= (const GLfloat value);

  //Functions
  GLfloat Length(void) const;
  Vector Normalize(void) const;
	void Copy2f(GLfloat* tab) const;
  void Copy3f(GLfloat* tab) const;
  void Copy4f(GLfloat* tab) const;

  //Special vector
  static const Vector ZERO;
  static const Vector ONES;
  static const Vector UNIT_X; 
  static const Vector UNIT_Y; 
  static const Vector UNIT_Z; 
  static const Vector NEGATIVE_UNIT_X; 
  static const Vector NEGATIVE_UNIT_Y; 
  static const Vector NEGATIVE_UNIT_Z;   
};

#endif
